Ambry Manual:
Top ~
Up ~
Next ~
Previous
Any natural language expression, for example, "(1 + 2) / 4" can be evaluated by Ambry's expression parser. Use the at-sign '@' to roll dice "3@6" will total the results of three 6-sided dice. You can also surround any part of an expression with parentheses to make it evaluate first parenthetical expressions are evaluated from the innermost outwards.
All whitespace spaces, tabs, and carriage returns in an expression is ignored. If an expression cannot be parsed, an appropriate error message is displayed in the output window.
Within a single expression sequence, you can evaluate multiple expressions by separating them with semi-colons ';' -- "1 + 3;2 @ 4;" will evaluate both "1 + 3" and "2 @ 4".
Finally, you can store values in variables. Variables are denoted using a dollar sign '$' then the variable name. For example, "$count = 1 @ 3; $count @ 8 + $count" will assign the result of "1 @ 3" to the variable "$count", then evaluate $count 8-sided die and add the value of $count.
You can retrieve the value of objects in expressions by entering the object's ID, a period, and then the property name. Objects selected in the frontmost document window are accessed through the special variables "$self" and "$selection". The variable $self contains the first selected object's ID, and the variable $selection contains a list of all selected object IDs.
Expressions are evaluated in a specific order, as summarized in the table below. The operations of the highest priority are evaluated first, followed by those of the next priority and so on. Operations of the same priority are evaluated from left to right. Parentheses may be used around an operation or set of operations to evaluate that expression first parenthetical expressions are evaluated from inside to outside.
Order, from highest to lowest | Operations |
Variable reference | $variableName |
Property reference | objectID."propertyName" |
Parentheses | ( expression ) |
Sign change | +, - |
Logical negation | ! |
Exponent | ^ |
Die operator | @ |
Multiplication and division | *, / |
Addition and subtraction | +, - |
Comparison | ==, !=, >=, <=, >, < |
Logical and | && |
Logical or | || |
Assignment | =, +=, -=, *=, /= |
Copyright © 1998 Island Spirits Software. Ambry and Pip are trademarks of Island Spirits Software. Other trademarks are the property of their respective owners.